﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
using Nest;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ES.Client.Demo
{
    [ElasticsearchType(Name = "EventJoins")]
    public class HYEventJoin
    {
        public HYEventJoin()
        {
            ExtraFields = new Dictionary<string, string>();
            ExtraFieldsForES = new Dictionary<string, object>();
            ExtraFieldsForMongo = new BsonDocument();
            OrderIdList = new List<long>();
            RelativeSpotIds = new List<long>();
        }




        /// <summary>
        /// 相关的手机号码 (会包含 参会者的手机号码；  或者 接收转增票的人的手机号） 转赠中就是2个
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public List<string> RelativeMobilePhones
        {
            get
            {
                if (_RelativeMobilePhones == null)
                {
                    _RelativeMobilePhones = new List<string>();
                }

                if (string.IsNullOrWhiteSpace(this.Mobile) == false && !_RelativeMobilePhones.Contains(this.Mobile))
                {
                    _RelativeMobilePhones.Add(this.Mobile);
                }

                return _RelativeMobilePhones;
            }
            set { _RelativeMobilePhones = value; }
        }


        /// <summary>
        /// 联系人的手机号码  冗余字段;
        /// 
        /// 2 导入的没有联系人
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string ContactMobilePhone { get; set; }



        /// <summary>
        /// 相关的手机号码 (会包含 参会者的手机号码； 或者接收转增票的人的手机号）
        /// </summary>
        [BsonIgnore]
        [Nest.String(Ignore = true, Index = FieldIndexOption.No)]
        private List<string> _RelativeMobilePhones { get; set; }


        /// <summary>
        /// 唯一标识身份  根据guid生成
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string uuid { get; set; }



        /// <summary>
        /// 会议开始 开始时间
        /// </summary>
        [Nest.Date(Format = "yyyy-MM-dd'T'HH:mm:ss.SSS'+'Z||yyyy-MM-dd'T'HH:mm:ss||strict_date_optional_time", IgnoreMalformed = true)]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local), JsonConverter(typeof(IsoDateTimeConverter))]
        public DateTime EventDateFrom { get; set; }



        /// <summary>
        ///  会议结束时间
        /// </summary>
        [Nest.Date(Format = "yyyy-MM-dd'T'HH:mm:ss.SSS'+'Z||yyyy-MM-dd'T'HH:mm:ss||strict_date_optional_time", IgnoreMalformed = true)]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local), JsonConverter(typeof(IsoDateTimeConverter))]
        public DateTime EventDateTo { get; set; }


        //    public static List<string> JoinFiledsDefault = new List<string>() { "Company", "PosStatusEx", "RealName", "Email", "Mobile" };


        /// <summary>
        ///  待审核 0;   已审核 1; 已拒绝 2;  取消报名 3;  请假 4
        /// </summary>
        public enum JoinStatus
        {
            待审核 = 0,
            已审核 = 1,
            已拒绝 = 2,
            取消报名 = 3,
            请假 = 4
        }

        ///// <summary>
        ///// 增加了个字段，是否发送签到电子票  ---  就是老系统的 old_JoinUser.SendCodeTimes>0
        ///// </summary>
        //public bool IsSendSignInCode { get; set; }


        /// <summary>
        /// 网站报名、通讯录导入、通讯录添加、手机报名、签到导入、签到添加、站外报名、网站报名代购、报名啦
        /// </summary>
        public enum JoinFromSite
        {
            /// <summary>
            /// 网站报名 (网页自主报名)
            /// </summary>
            [Description("网站报名")]
            WebJoin = 0,

            /// <summary>
            /// 通讯录导入(网页批量导入)
            /// </summary>
            [Description("网页批量导入")]
            WebImport = 1,

            /// <summary>
            /// 通讯录添加 (网页手工添加)
            /// </summary>
            [Description("网页手工添加")]
            FromContacts = 2,

            /// <summary>
            /// 手机报名 (签到自主报名)
            /// </summary>
            [Description("手机报名")]
            Mobile = 3,

            /// <summary>
            /// 签到导入
            /// </summary>
            [Description("签到导入")]
            SignInImport = 4,

            /// <summary>
            /// 签到添加 (签到手工添加)
            /// </summary>
            [Description("签到添加")]
            SignInAdd = 5,

            /// <summary>
            /// 站外报名 (手机自主报名)
            /// </summary>
            [Description("站外报名")]
            OutSideJoin = 6,

            /// <summary>
            /// 网站报名代购 (手机导入-属于自主报名)
            /// </summary>
            [Description("网站报名代购")]
            WebJoinOther = 7,

            /// <summary>
            /// 3188-属于自主报名
            /// </summary>
            [Description("3188.la")]
            WeiXin3188 = 8,

            /// <summary>
            ///  --属于自主报名
            /// </summary> 
            [Description("iTeaLa")]
            iTeaLa = 9,

            /// <summary>
            /// 报名啦--属于自主报名
            /// </summary>
            [Description("报名啦")]
            BaoMingLa = 10,


            /// <summary>
            /// 3188自助打赏
            /// </summary>
            [Description("3188自助打赏")]
            EventAward = 11,


            ///// <summary>
            ///// 酒店房间预订--属于自主报名
            ///// </summary>
            [Description("酒店房间预订")]
            HotelBooking = 100,


            /// <summary>
            /// 相见app
            /// </summary>
            [Description("相见app")]
            XiangJian = 200,

            /// <summary>
            /// 其它
            /// </summary>
            [Description("其它")]
            Other = 1000,
        }


        //public enum JoinFromSite
        //{
        //    网页自主报名 = 0,
        //    网页导入 = 1,
        //    网页手工添加 = 2,

        //    签到自主报名 = 3,
        //    签到导入 = 4,
        //    签到手工添加 = 5,
        //    手机自主报名 = 6,

        //    手机导入 = 7,
        //    手机手工添加 = 8,
        //    酒店房间预订 = 100,

        //    其他 = 1000
        //}


        public enum PayTypeEnum
        {
            用户自主支付 = 0,

            主办方手动设置 = 1
        }

        /// <summary>
        /// 区分手动标记已支付、用户自主支付 
        /// 作废不用了的 2015-4-16
        /// </summary>
        [Obsolete]
        public PayTypeEnum PayType { get; set; }


        /// <summary>
        /// 会议报名用户的业务主键
        /// </summary>
        public long JoinId { get; set; }

        /// <summary>
        /// 是否已经分配给真实的报名用户（分配/分发了，就一定会有报名用户的姓名，手机，邮箱）； 2014-12-11讨论添加
        /// 
        /// true 表示已经 实名；  false 表示匿名
        /// </summary>
        public bool IsAssigned { get; set; }

        /// <summary>
        /// 国家
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string CountryEx { get; set; }

        /// <summary>
        /// 市
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string CityEx { get; set; }

        #region 票务冗余字段

        /// <summary>
        /// 票的原价
        /// </summary>
        public double TicketPrice { get; set; }


        /// <summary>
        /// 票的名称
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string TicketTitle { get; set; }


        /// <summary>
        /// 通道名称 2015-1-25
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string JoinCateName { get; set; }

        #endregion


        /// <summary>
        /// 选择的日程
        /// </summary>
        public List<long> ScheduleIds { get; set; }


        /// <summary>
        /// 推广渠道ID
        /// </summary>
        public long? ChannelID { get; set; }


        /// <summary>
        /// 通道名称，需要通过第三方方法调用，才可设置值
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string ChannelName
        {
            get;
            set;
        }


        /// <summary>
        /// 推广渠道ID
        /// </summary>
        [BsonIgnore]
        [Nest.Number(Ignore = true)]
        private long? _ChannelID { get; set; }

        /// <summary>
        /// 省
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string ProvinceEx { get; set; }




        /// <summary>
        ///   
        /// 1: Scrm的公司Id； 不是主办方；专门为了和scrm对接用;  null 和0表示没有;       
        /// 2： 非美加的订单，系统自动根据EventId赋值；
        /// 3: 美加订单，必须自己给出数值
        /// </summary>
        public long? ScrmCompanyId { get; set; }


        /// <summary>
        ///   
        ///  Scrm的公司Id； 不是主办方；专门为了和scrm对接用;  null 和0表示没有;
        /// 
        /// </summary>
        [BsonIgnore]
        [Nest.Number(Ignore = true)]
        private long? _ScrmCompanyId { get; set; }

        /// <summary>
        /// 美加推广人列表
        /// </summary>
        //public List<PromoterSimpleInfo> ScrmPromoterList { get; set; }
        /// <summary>
        /// 会员编号-可用于3188Saas会员验证
        /// </summary> 
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string MemberNumber { get; set; }

        /// <summary>
        /// 就是老系统的  WXOpenId,
        /// 2016-09-22，后来做个人中心，又用这个字段，说不能加字段，所以这个字段存的格式为
        /// OpenId|AppId
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string WeiXinOpenId { get; set; }

        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string WeiXinAppId { get; set; }

        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string EventTitle { get; set; }

        /// <summary>
        /// 是否允许候补报名 3188
        /// </summary>
        public bool IsPrePare { get; set; }

        /// <summary>
        /// 地址
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.Analyzed, Analyzer = "ik")]
        public string Address { get; set; }

        /// <summary>
        /// 会议ID
        /// </summary>
        public long EventId { get; set; }

        /// <summary>
        ///  
        /// </summary>
        public long UserId { get; set; }


        /// <summary>
        /// 通道ID
        /// </summary>
        public long JoinCateId { get; set; }


        ///// <summary>
        ///// 通道名称 2015-1-25   和 TicketName 摆在一起
        ///// </summary>
        //public string JoinCateName { get; set; }

        /// <summary>
        /// 当报名用户是购买门票时候，的门票Id；否则就是0; 相当于冗余字段
        /// </summary>
        public long TicketId { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed, IgnoreAbove = 10922)]
        public string RealName { get; set; }

        /// <summary>
        /// 用户头像  ---默认就增加了
        ///1 存储 微信的头像地址 类似： http://wx.qlogo.cn/mmopen/9cVF63VAEibhGx3zeo2AIvu6yCiaeorX7NgaJiaFMxUGUn8I7rxLxX2Qo88rlSsyK29ic3otOGmu8yLSsat4WFROcJriaiajt7O1qx/0
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed, IgnoreAbove = 10922)]
        public string EventUserJoinImage { get; set; }

        /// <summary>
        /// 是否允许修改名片
        /// </summary>
        public bool AllowExchangeNameCard { get; set; }


        /// <summary>
        /// 邮箱
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string Email { get; set; }


        /// <summary>
        /// 邮箱
        /// </summary>
        [BsonIgnore]
        [Nest.String(Ignore = true, Index = Nest.FieldIndexOption.No)]
        private string _Email { get; set; }



        /// <summary>
        /// 审核状态最后更新时间 (审核成功/审核拒绝时间）;没有就是空;
        /// 赋值时候请 使用 DateTime.Now.ToString()
        /// </summary> 
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string ConfirmTime { get; set; }


        /// <summary>
        /// 名片路径
        /// </summary> 
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string CardImagePath { get; set; }

        /// <summary>
        /// 公司名
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string Company { get; set; }

        /// <summary>
        /// 职位
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string PosStatusEx { get; set; }

        /// <summary>
        /// 手机
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string Mobile { get; set; }

        /// <summary>
        /// 手机
        /// </summary>
        [BsonIgnore]
        [Nest.String(Ignore = true, Index = Nest.FieldIndexOption.No)]
        private string _Mobile { get; set; }


        /// <summary>
        /// 公众号的OpenId
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string PNOpenId { get; set; }

        /// <summary>
        /// 微信
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string WeiXin { get; set; }

        /// <summary>
        /// 是否签到
        /// </summary>
        public bool IsSignIn { get; set; }

        /// <summary>
        ///最后一次 签到时间
        /// </summary>
        [Nest.Date(Format = "yyyy-MM-dd'T'HH:mm:ss.SSS'+'Z||yyyy-MM-dd'T'HH:mm:ss||strict_date_optional_time", IgnoreMalformed = true)]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local), JsonConverter(typeof(IsoDateTimeConverter))]
        public DateTime? SignInTime { get; set; }

        /// <summary>
        ///   签到码 ----以后需要讨论FRID码
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string SignInCode
        {
            get
            {

                if (string.IsNullOrWhiteSpace(_SignInCode) == false)
                {
                    return _SignInCode.ToUpper();
                }

                return "";
            }
            set { _SignInCode = value; }
        }

        /// <summary>
        ///   签到码 ----以后需要讨论FRID码
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        private string _SignInCode { get; set; }

        /// <summary>
        /// 支付状态
        /// (  如果需要补缴余额: 
        /// 1 在没补缴完成前， join.isPaid=false, join.Retroactive.IsRetroactiveSuccess = false;  RequiredRetroactive.RequiredRetroactive= true;
        /// 2 补缴完成后 join.isPaid=true, join.Retroactive.IsRetroactiveSuccess = true;  RequiredRetroactive.RequiredRetroactive= true;
        /// )        
        /// </summary>
        public bool IsPaid { get; set; }




        /// <summary>
        /// 最后支付时间
        /// </summary>
        [Nest.Date(Format = "yyyy-MM-dd'T'HH:mm:ss.SSS'+'Z||yyyy-MM-dd'T'HH:mm:ss||strict_date_optional_time", IgnoreMalformed = true)]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local), JsonConverter(typeof(IsoDateTimeConverter))]
        public DateTime? PayTime { get; set; }

        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string AddIP { get; set; }

        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string UpdateIP { get; set; }


        //[BsonDateTimeOptions(Kind = DateTimeKind.Local), JsonConverter(typeof(IsoDateTimeConverter))]
        //public DateTime? LastLoginTime { get; set; }
        //public string LastLoginIP { get; set; } 单独添加日志记录


        /// <summary>
        /// 报名来源
        /// </summary>
        public JoinFromSite FromSite { get; set; }


        /// <summary>
        /// 是否是 web/签到软件导入的 (不存取mongodb)
        /// </summary>
        [BsonIgnore]
        [Nest.Boolean(Ignore = true)]
        public bool IsImported
        {
            get
            {
                if (FromSite == JoinFromSite.WebImport || FromSite == JoinFromSite.FromContacts || FromSite == JoinFromSite.SignInImport || FromSite == JoinFromSite.SignInAdd)
                {
                    return true;
                }
                else
                    return false;
            }
        }

        ///// <summary>
        ///// 报名来源域名
        ///// </summary>
        //public string FromHost { get; set; }

        ///// <summary>
        ///// 来自主办方小站报名
        ///// </summary>
        //public long FromCompany { get; set; }

        /// <summary>
        /// 标签
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string UserGroup { get; set; }

        /// <summary>
        /// 是否代报名
        /// </summary>
        public bool IsSubstitued { get; set; }

        ///// <summary>
        ///// 代报名人名
        ///// </summary>
        //public string SubsRealName { get; set; }

        ///// <summary>
        ///// 代报名人手机
        ///// </summary>
        //public string SubsMobile { get; set; }

        ///// <summary>
        ///// 代报名人邮箱
        ///// </summary>
        //public string SubsEmail { get; set; }

        /// <summary>
        /// 附加字段  [BsonDictionaryOptions(DictionaryRepresentation.Document)]
        /// </summary> 
        [Nest.Object(Ignore = true)]
        [BsonDictionaryOptions(DictionaryRepresentation.Document)]
        public Dictionary<string, string> ExtraFields { get; set; }

        /// <summary>
        /// ES反序列化时使用此字段
        /// JSON反序列化时使用此字段
        /// 新增和修改数据保存MongoDB时忽略此字段
        /// </summary>
        [BsonIgnore]
        [JsonProperty("ExtraFieldsForES")]
        [Nest.Object(Name = "ExtraFieldsForES")]
        public Dictionary<string, object> ExtraFieldsForES { get; set; }

        /// <summary>
        /// 此字段用于新增和修改数据保存MongoDB时使用
        /// mongo-connector会根据此字段把变更部分同步到ES
        /// ES反序列化时忽略此字段
        /// JSON反序列化时忽略此字段
        /// 此字段使用BsonDocument是为了提高数据精度
        /// </summary>
        [JsonIgnore]
        [Nest.Object(Ignore = true)]
        [BsonElement("ExtraFieldsForES")]
        public BsonDocument ExtraFieldsForMongo { get; set; }


        ///// <summary>
        ///// 购票明细，存储购票明细列表ID
        ///// </summary>
        //public List<long> TicketDetailIDs { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.Analyzed, Analyzer = "ik")]
        public string Remarks { get; set; }


        /// <summary>
        /// 报名时间；  （因为签到软件是离线操作，数据库创建时间CreateTime 不是报名时间;  录入数据录入时间;）
        /// </summary>
        [Nest.Date(Format = "yyyy-MM-dd'T'HH:mm:ss.SSS'+'Z||yyyy-MM-dd'T'HH:mm:ss||strict_date_optional_time", IgnoreMalformed = true)]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local), JsonConverter(typeof(IsoDateTimeConverter))]
        public DateTime AddTime
        {
            get
            {
                if (_AddTime.Year < 1980)
                {
                    _AddTime = DateTime.Now;
                }
                return _AddTime;
            }

            set
            {
                _AddTime = value;
            }
        }

        /// <summary>
        /// 报名时间；  （因为签到软件是离线操作，数据库创建时间CreateTime 不是报名时间）
        /// </summary>
        [Nest.Date(Format = "yyyy-MM-dd'T'HH:mm:ss.SSS'+'Z||yyyy-MM-dd'T'HH:mm:ss||strict_date_optional_time", IgnoreMalformed = true)]
        private DateTime _AddTime { get; set; }

        /// <summary>
        /// 打赏总金额
        /// </summary>
        public double TotalAwardMoney { get; set; }
        /// <summary>
        /// 最后一次打赏时间
        /// </summary>
        [Nest.Date(Format = "yyyy-MM-dd'T'HH:mm:ss.SSS'+'Z||yyyy-MM-dd'T'HH:mm:ss||strict_date_optional_time", IgnoreMalformed = true)]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local), JsonConverter(typeof(IsoDateTimeConverter))]
        public DateTime? LastAwardTime { get; set; }
        /// <summary>
        /// 所中奖项编号 允许多个  逗号隔开
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string AwardLotteryIds { get; set; }

        ///// <summary>
        ///// 用户预订酒店信息
        ///// </summary>
        //public List<HYEventHotelSchedule> HotelSchedule { get; set; }
        /// <summary>
        /// 参会者联系人编号;   如果是签到软件导入还没有联系人;
        /// </summary>
        public long JoinContactId { get; set; }

        /// <summary>
        /// 参会者关联的订单编号
        /// </summary>
        public List<long> OrderIdList { get; set; }


        /// <summary>
        /// 如果是客户买票则存在 订单号；否则就是导入的，或者添加的
        /// </summary>
        public bool ExistOrder { get; set; }


        /// <summary>
        /// 签到点( 某个报名用户在哪几个签到点签到过）---曹明和伍鹏讨论后添加的;存储在mongDB中,每次签到要更新这个字段
        /// </summary>
        public List<long> RelativeSpotIds { get; set; }



        /// <summary>
        /// 扫描码（签到系统用）
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string TrackingCode { get; set; }
        /// <summary>
        /// 版本号（签到系统用）
        /// </summary>
        public int RecordVersion { get; set; }


        /// <summary>
        /// 使用的折扣码/优惠码; 冗余字段 ( 多个报名用户可能是公用一个 优惠码)
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public List<string> DiscountCode { get; set; }


        /// <summary>
        /// 研习入社优惠码
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string SiteDiscountCode { get; set; }

        /// <summary>
        /// 报名状态  待审核 0;   已审核 1; 已拒绝 2;  取消报名 3;  请假 4
        /// </summary>
        public JoinStatus Status { get; set; }


        /// <summary>
        /// 实际发送签到码的次数   ---签到系统后期添加2014-12-23
        /// </summary>
        public int SendCodeTimes { get; set; }



        /// <summary>
        /// 允许发送电子码的次数（扣5块钱加两次）
        /// </summary>
        public int AllowSendCodeTimes { get; set; }

        /// <summary>
        /// 允许发送短信通知的次数（扣5块钱加10次）
        /// </summary>
        public int AllowSendSMSTimes { get; set; }


        /// <summary>
        /// 实际发送短信通知的次数，如果发送长短信，需要按拆分后的条数计算
        /// </summary>
        public int SendSMSTimes { get; set; }

        /// <summary>
        /// 是否因为互动短信已经扣费，只扣一次
        /// </summary>
        public bool UseReplySMS { get; set; } // 


        /// <summary>
        /// 身份证件号码   ---签到系统后期添加2014-12-23
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string IdCardNo { get; set; }

        /// <summary>
        /// 通知邮件是否被打开过
        /// </summary>
        public bool IsEmailOpened { get; set; } //通知邮件是否被打开过


        /// <summary>
        /// 身份证件类型，身份证，护照，驾照
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string IdCardType { get; set; }

        /// <summary>
        /// 打印次数  ---签到系统后期添加2014-12-23
        /// </summary>
        public int PrintCount { get; set; }

        /// <summary>
        /// 部门   ---签到系统后期添加2014-12-23
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string DepartmentEx { get; set; }

        /// <summary>
        /// 定制的打印背景 ---签到系统后期添加2014-12-23
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string PrintBG { get; set; }
        /// <summary>
        /// 最后一次打印时间 ---签到系统后期添加2014-12-23
        /// </summary>
        [Nest.Date(Format = "yyyy-MM-dd'T'HH:mm:ss.SSS'+'Z||yyyy-MM-dd'T'HH:mm:ss||strict_date_optional_time", IgnoreMalformed = true)]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local), JsonConverter(typeof(IsoDateTimeConverter))]
        public DateTime? LastPrintTime { get; set; }

        /// <summary>
        /// 参会者姓名的拼音 ---签到系统后期添加2014-12-23
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed, IgnoreAbove = 10922)]
        public string FullPY { get; set; }
        /// <summary>
        ///签到来源（全小写，wechat）
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string SignInFromName { get; set; }


        /// <summary>
        /// 参会人所属角色集合
        /// </summary>
        public List<long> RoleIds
        {
            get;
            set;
        }
        /// <summary>
        /// 角色名集合
        /// </summary>
        [Nest.String(Ignore = true, Index = FieldIndexOption.No)]
        public string RoleName { get; set; }

        #region 套票新增字段(请假)
        /// <summary>
        /// 请假理由
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.Analyzed, Analyzer = "ik")]
        public string LeaveReason { get; set; }
        /// <summary>
        /// 请假审批拒绝原因
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.Analyzed, Analyzer = "ik")]
        public string RejectReason { get; set; }



        [Nest.Date(Format = "yyyy-MM-dd'T'HH:mm:ss.SSS'+'Z||yyyy-MM-dd'T'HH:mm:ss||strict_date_optional_time", IgnoreMalformed = true)]
        public DateTime? ApprovalTime { get; set; }

        #endregion
        #region 申请修改报名信息
        /// <summary>
        /// 修改参会人字段的内容
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed, IgnoreAbove = 10922)]
        public string AlterJoinFieldContent { get; set; }
        #endregion

        /// <summary>
        /// 参会人编号
        /// </summary>
        public int JoinNumber { get; set; }
        /// <summary>
        /// 操作人的名称
        /// </summary>
        [Nest.String(Index = Nest.FieldIndexOption.NotAnalyzed)]
        public string OperatingUserName { get; set; }
    }
}
